/**
 * Created by zander on 2017/12/8.
 */
/**
 * Created by zander on 2017/12/6.
 */
function getProject() {
    var a = document.getElementById("Project");
    var b = a.options[a.selectedIndex].value;
    return b;
}

function clearInfo() {
    var localStorage = window.localStorage;
    var project = getProject();
    var phone = document.getElementById('inputPhone').value;
    var identifier = document.getElementById('inputID').value;
    var username = localStorage.getItem('name');
    sure(username,project,phone,identifier);
}
function sure(username,project,phone, identifier) {
    bootbox.confirm({
        size: "small",
        message: "是否确认清除用户数据?",
        callback: function (result) {
            if (result == true) {

            } else {

            }
        }
    })
}

function check(e) {
    var id = $(e).attr('id');
    var number = document.getElementById(id).value;
    if (number == ""){
        return true
    }
    // var patrn = /^\+?[1-9][0-9]*$/;
    var patrn = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)|(^\+?[1-9][0-9]*$)/;
    if (!patrn.test(number)){
        alert("只允许输入数字！");
        $(e).text("");
    }
}
